/**
 * 标签表
 * Created by Freeman on 2016/6/27.
 */
"use strict";



var mongoose = require('./mongoosedb').mongoose;

var Schema = mongoose.Schema;

var TagsSchema = new Schema({
    name:{
        type:String,
        unique:true
    },
    cid:{
        type:Schema.Types.ObjectId,
        ref:'TagCategory'
    },
    is_index:{
        type:Boolean,
        default:false
    },
    is_show: {
        type:Boolean,
        default:false
    },
    sort:{
        type:Number,
        default:1
    }
});

var Tag = mongoose.model('Tag',TagsSchema);

var Promise = require('bluebird');
Promise.promisifyAll(Tag);
Promise.promisifyAll(Tag.prototype);

module.exports = Tag;





